<!DOCTYPE html>
<html lang="zh-cn">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <meta name="referrer" content="never">
    <link rel="stylesheet" href="./css/base.css">
    <link rel="stylesheet" href="../css/animate.css">
    <script src="./js/common.js"></script>
    <title>电影首页</title>
    <script src="../js/vue.js"></script>
    <script src="./datas/home.js"></script>
    <script src="./datas/films.js"></script>
    <script src="./datas/detail.js"></script>
    <link rel="import" href="./components/TopBar.html">
    <link rel="import" href="./components/FilmItem.html">
    <link rel="import" href="./components/FilmList.html">
    <link rel="import" href="./components/BottomBar.html">

    <link rel="import" href="./pages/Home.html">
    <link rel="import" href="./pages/Films.html">
    <link rel="import" href="./pages/Detail.html">


</head>

<body>
    <!-- 项目容器 start-->
    <div class="app" id="app">
        <!-- 头部搜索框 start -->
        <top-bar></top-bar>
        <!-- 头部搜索框 end -->
        <!-- 首页正文 start -->
        <div class="content-box">
            <transition
                enter-active-class="animated fadeInRight"
                leave-active-class="animated fadeOutLeft"
            >
                <component :is="pageName"></component>
            </transition>
        </div>
        <!-- 首页正文 end -->
        <!-- 底部评论区 start -->
        <bottom-bar v-if="pageName=='DetailPage'"></bottom-bar>
        <!-- 底部评论区 end -->
    </div>
    <!-- 项目容器 end-->
</body>
<script>
    new Vue({
        el:"#app",
        data:{
            pageName:"HomePage"
        },
        beforeMount() {
            this.$root.$on("update:name",(name)=>{
                this.pageName = name;
            })
        },
    })
</script>
</html>